package com.linkgie.galaxyframework.keystore;

import com.linkgie.galaxyframework.crypto.CryptoKeypair;
import com.linkgie.galaxyframework.crypto.PrivateKey;
import com.linkgie.galaxyframework.crypto.PublicKey;

public class KeyEntry {

	private String alia;

	private PublicKey pubKey;

	private PrivateKey privKey;

	public KeyEntry(String alia, PublicKey pubKey, PrivateKey privKey) {
		this.alia = alia;
		this.pubKey = pubKey;
		this.privKey = privKey;
	}

	public KeyEntry(String alia, CryptoKeypair keypair) {
		this(alia, keypair.getPublic(), keypair.getPrivate());
	}

	public PublicKey getPubKey() {
		return pubKey;
	}

	public PrivateKey getPrivKey() {
		return privKey;
	}

	public CryptoKeypair getKeypair() {
		return new CryptoKeypair(pubKey, privKey);
	}

	public String getAlia() {
		return alia;
	}

	public void setAlia(String alia) {
		this.alia = alia;
	}
}
